﻿using FluentValidation;

namespace complex.Controllers.Customers
{
    public class NewCustomerInputModelCommand
    {
        public string Name { get; set; }
        public string Line1 { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string ZipCode { get; set; }
    }

    public class NewCustomerInputModelQuery
    {
    }

    public class NewCustomerOutputModel
    {
        public string Name { get; set; }
        public string Line1 { get; set; }
        public string City { get; set; }
        public string State { get; set; }
        public string ZipCode { get; set; }
    }

    public class AddCustomerInputModelValidator
        : AbstractValidator<NewCustomerInputModelCommand>
    {
        public AddCustomerInputModelValidator()
        {
            RuleFor(m => m.Name).NotEmpty().Length(1, 50);
            RuleFor(m => m.Line1).NotEmpty().Length(1, 25);
            RuleFor(m => m.City).NotEmpty().Length(1, 30);
            RuleFor(m => m.State).NotEmpty().Length(2);
            RuleFor(m => m.ZipCode).NotEmpty().Length(5);
        }
    }
}